A file system is a data structure for storing and organizing user data, and provides simple and convenient data access for a user. For a storage device providing a file system, storage space of a disk of the storage device is transparent to the user; the user does not need to care about a specific location of data stored in the disk, and may access the data merely by accessing a directory or a file.
A Redirect-On-Write (ROW) file system refers to a file system that writes data in a manner of redirect-on-write. When new user data is written or original user data is modified, the new data does not overwrite the original old data, and the data is written into newly-allocated space in the storage device. After the new data is written successfully, storage space of the old data is then released. However, as new data is constantly written, new storage space is constantly allocated in the storage device, and at the same time, storage space of old data is constantly released. However, new data cannot be written into the released storage space of the old data due to discreteness of the released storage space, causing a problem of storage space fragmentization in the disk. Therefore, it is necessary to defragment the storage space; defragmentation indicates organizing small discrete available storage space into large continuous storage space.